package com.sikaryofficial.workbench.constant;

import lombok.Getter;

/**
 * 商品描述类型
 */
@Getter
public enum GoodsDescTypeEnum {

    DESC(1, "描述"),
    SPEC(2, "参数");

    private final Integer code;
    private final String desc;

    GoodsDescTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static GoodsDescTypeEnum getByCode(Integer code) {
        for (GoodsDescTypeEnum goodsDescTypeEnum : GoodsDescTypeEnum.values()) {
            if (goodsDescTypeEnum.getCode().equals(code)) {
                return goodsDescTypeEnum;
            }
        }
        return null;
    }
}
